<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录页</title>
<link rel="stylesheet" href="${ctx}/static/layui/css/layui.css">
</head>

<body
	style="background-image: url('${ctx}/static/img/login-bg.jpg');opacity: 0.8">
	<div class="login-main" align="center"
		style="height: 300px;width: 400px;background-color: #F0BBFF;opacity: 0.9;margin-top: 20%;margin-left: 40%;background-image: url('${ctx}/static/img/bg.jpg');">

		<form class="layui-form" action="${ctx}/user/login" method="post">
			<p>
			<div class="layui-input-inline" style="margin-top: 50px">
				<input type="text" name="username" required lay-verify="required"
					placeholder="用户名" autocomplete="off" class="layui-input">
			</div>
			</p>

			<p>
			<div class="layui-input-inline" style="margin-top: 20px">
				<input type="password" name="password" required
					lay-verify="required" placeholder="密码" autocomplete="off"
					class="layui-input">
			</div>
			</p>

			<p>
			<span style="color: red;font-size: 16px">${error}</span>
			<div class="layui-input-inline login-btn" style="margin-top: 20px">
				<button  class="layui-btn" id="login">登录</button>
			</div>
			</p>
			<div class="layui-input-inline" style="margin-top: 30px">
				<button type="button" class="layui-btn layui-btn-primary">QQ登录</button>
			</div>
			<div class="layui-input-inline"
				style="margin-left: 8px; margin-top: 30px">
				<button type="button" class="layui-btn layui-btn-normal">微信登录</button>
			</div>
		</form>
	</div>                 

	<script src="http://code.jquery.com/jquery-latest.js"></script>
	<script>
		$(function (){
			$("#login").on('click', function(){
			    //alert("进入ajax")
			    
			    $.post('${ctx}/user/login', {
			    	"username" : username,
			   	 	"password" : password
			    }, function () {
			    });
			 })
		})
	</script>
</body>

</html>